Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix miscellaneous bugs in fs.wrap #470

Merged
merged 6 commits into from
Mar 26, 2021
Merged

Fix miscellaneous bugs in fs.wrap #470

merged 6 commits into from
Mar 26, 2021

Conversation

althonos
Copy link
Member

@althonos althonos commented Mar 26, 2021

Type of changes

  • Bug fix
  • Tests

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @PyFilesystem/maintainers may be pedantic in the code review.

Description

This PR fixes the following issues:

  • fs.wrap.WrapReadOnly did not wrap the removetree method, meaning a filesystem could still be wiped if this command was called. Closes WrapReadOnly does not wrap removetree #468 .
  • fs.wrap.WrapCachedDir methods isdir and isfile would raise ResourceNotFound instead of returning False on non-existing paths.

I also added more tests for these two classes, and in particular a test making sure fs.copy, fs.move and fs.mirror respect WrapReadOnly semantics; this is to avoid any new undetected removal that could occur if #429 or similar improvements are added which could use os functions to improve performance in various places when given filesystems with a syspath.

@althonos althonos added the bug label Mar 26, 2021
@coveralls
Copy link

coveralls commented Mar 26, 2021

Coverage Status

Coverage increased (+0.008%) to 95.329% when pulling 235b56a on readonly-removetree into 94f0323 on master.

@althonos althonos merged commit 99d5314 into master Mar 26, 2021
@althonos althonos deleted the readonly-removetree branch March 26, 2021 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WrapReadOnly does not wrap removetree
2 participants